﻿using System;
using Xtensive.Core;
using Xtensive.Orm;

namespace KeyWithSortOrder.Model
{
    /*
     * By default, primary keys have ascending order. However, in case it should be descending, 
     * use [Key(Direction = Direction.Negative)] construct.
     */
    [HierarchyRoot]
    public class AuditRecord : Entity
    {
        [Field, Key(Direction = Direction.Negative)]
        public DateTime RecordTime { get; set; }

        [Field]
        public string Event { get; set; }

        public AuditRecord(Session session, DateTime recordTime) :
            base(session, recordTime) { }
    }
}